#ifndef ConfigEditor_H
#define ConfigEditor_H

#include <QWidget>
#include "global.h"

class ConfigDataModel;
class ConfigItem;
class SwitchButton;
class QStackedWidget;
class ConfigEditor : public QWidget
{
    Q_OBJECT
public:

    ConfigEditor(ConfigDataModel *data, QWidget *parent = nullptr);
    ~ConfigEditor();
    void updateAllConfig(UpdateOption option);
    void updateOneConfig(QWidget *widget);
    void updateOneConfig(ConfigItem *item, UpdateOption ops = UpdateOption::WidgetContent);

protected:
    void paintEvent(QPaintEvent *event) override;
private slots:
    //void onItemEdited();


private:
    ConfigDataModel *m_data;
    SwitchButton *switchButton;
    QStackedWidget *stackWidget;

signals:
    void finished();
};
#endif // WIDGET_H
